home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / Drtf / DHTMLprocess.h < prev    next >
Text File  |  1996-07-05  |  3KB  |  115 lines

  1. // DHTMLprocess.h
  2. // d.g.gilbert
  3.  
  4. #ifndef _DHTMLPROCESS_
  5. #define _DHTMLPROCESS_
  6.  
  7. #include "DRichProcess.h"
  8.  
  9.  
  10. struct HTMLKey
  11. {
  12.     short    htmlKMajor;    /* major number */
  13.     short    htmlKMinor;    /* minor number */
  14.     char    *htmlKStr;    /* symbol name */
  15.     short    htmlKStop;    /* type of key termination */
  16.     short    htmlKHash;    /* symbol name hash value */
  17. };
  18.  
  19.  
  20.      
  21. class DHTMLprocess : public DRichprocess
  22. {
  23. public:
  24.     static void InitKeys();
  25.  
  26.     DHTMLprocess( DFile* itsFile, DRichView* itsDoc, Nlm_MonitorPtr progress);
  27.                                 //DGopherList* itsLinks
  28.     virtual ~DHTMLprocess();
  29.  
  30.     virtual void    handleTextClass();
  31.     virtual void    handleControlClass(); 
  32.  
  33. protected:
  34.     
  35.     enum majorKeys {
  36.         htmlDocAttr,
  37.         htmlLinkAttr,
  38.         htmlFormAttr,
  39.         htmlCharAttr,
  40.         htmlParAttr,
  41.         htmlListAttr,
  42.         htmlPictAttr,
  43.         htmlSpecialChar,
  44.         htmlEndControl
  45.         };
  46.     
  47.     enum minorKeys {
  48.         htmlHTML, htmlTitle, htmlHead, htmlBody, htmlIsIndex, htmlLink, htmlNextID, htmlBase,
  49.         htmlAnchor, htmlHref, htmlName, htmlRel, htmlRev, htmlUrn, htmlMethods,
  50.         htmlBold,htmlEmphasis,htmlMoreEmphasis,htmlItalic,htmlFixedwidth,
  51.         htmlPlain, htmlSampleFont,htmlUserFont,htmlVarFont,htmlDefineFont,htmlCiteFont,
  52.         htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,htmlAddress,htmlBlockquote,
  53.         htmlPreformat,htmlLinewidth, 
  54.         htmlDL,htmlCompact,htmlDT,htmlDD,
  55.         htmlBullList,htmlNumList,htmlMenu,htmlDir,htmlListItem,
  56.         htmlImage,htmlImageSrc,htmlImageAlt,htmlAlign, htmlIsMap,
  57.         htmlForm, htmlInput, htmlSelect, htmlTextarea, htmlValue, 
  58.         htmlType, htmlOption, htmlAction, htmlMethod,
  59.         htmlChecked,htmlSelected,htmlMultiple,htmlSize,htmlMaxlength,htmlRows,htmlCols,
  60.         htmlInvisible, htmlComment,
  61.         htmlNoKey = -1
  62.         };
  63.     
  64.     enum specialChars {
  65.         htmlPar= 300, htmlHBar, htmlNewline, htmlPage, htmlTab, 
  66.         htmlNoChar = -1
  67.         };
  68.         
  69.     enum    stopKeys {
  70.         kNoStop,
  71.         kSlashStop,
  72.         kAmperChar // special characters of &char; style
  73.         };
  74.     
  75.     static HTMLKey htmlKeys[];
  76.     static HTMLKey htmlAmperChars[];
  77.     static short Hash( char    *s);
  78.  
  79.     Boolean fInControl, fTurnOn, fPreformat, fIsIndex, fInForm, 
  80.                     fInHead, fInParam, fIsMap,
  81.                     fIsChecked, fIsMultiple;
  82.     char      fQuote, fTokenBuf[kMaxTokenBuf];
  83.     long        fTokenLen;
  84.     short        fListType, fListNum, fDLStyle, // these need to be stacks ??
  85.                     fStop, fCurControl, fCurField, fCurItem, fLastField,
  86.                     fSelectitem, fPicLink, fAnchorLink;
  87.      char    * fURLstore, * fNamestore, * fFormURL, * fGoplusStore,
  88.                 * fSizestore, * fMaxlengthstore, * fRowsstore, * fColsstore,
  89.                * fMethodstore, * fValstore, * fTypestore, *fOptionstore;
  90.   char  * fPushBuf, * fPushBufstore;
  91.   long    fPushSize;
  92.   
  93.     //DGopherList * fGolist;
  94.  
  95.     virtual void    handleDocAttr( short attr);  
  96.     virtual void    handleLinkAttr( short attr); 
  97.     virtual void    handleFormAttr( short attr); 
  98.     virtual void    handleCharAttr( short attr); 
  99.     virtual void    handleParAttr( short attr);  
  100.     virtual void    handleListAttr( short attr);  
  101.     virtual void    handlePictAttr( short attr); 
  102.     virtual void    handleSpecialChar( short code); 
  103.     virtual void    handleEndControl( short attr);  
  104.  
  105.     virtual void  GetToken1(); // private
  106.     virtual short GotTokenOrParam(); // private
  107.     virtual short GetOneChar();
  108.     virtual void  Pushback(char c);
  109.     virtual void  Lookup( char *s, HTMLKey* keyset);
  110. };
  111.  
  112.  
  113.  
  114. #endif
  115.